3.11.97 \(\int x (A+B x) (a+b x+c x^2)^p \, dx\) [1097]

Optimal. Leaf size=211 \[ -\frac {(b B (2+p)-A c (3+2 p)-2 B c (1+p) x) \left (a+b x+c x^2\right )^{1+p}}{2 c^2 (1+p) (3+2 p)}+\frac {2^p \left (2 a B c-b^2 B (2+p)+A b c (3+2 p)\right ) \left (-\frac {b-\sqrt {b^2-4 a c}+2 c x}{\sqrt {b^2-4 a c}}\right )^{-1-p} \left (a+b x+c x^2\right )^{1+p} \, _2F_1\left (-p,1+p;2+p;\frac {b+\sqrt {b^2-4 a c}+2 c x}{2 \sqrt {b^2-4 a c}}\right )}{c^2 \sqrt {b^2-4 a c} (1+p) (3+2 p)} \]

[Out]

-1/2*(b*B*(2+p)-A*c*(3+2*p)-2*B*c*(1+p)*x)*(c*x^2+b*x+a)^(1+p)/c^2/(2*p^2+5*p+3)+2^p*(2*a*B*c-b^2*B*(2+p)+A*b*
c*(3+2*p))*(c*x^2+b*x+a)^(1+p)*hypergeom([-p, 1+p],[2+p],1/2*(b+2*c*x+(-4*a*c+b^2)^(1/2))/(-4*a*c+b^2)^(1/2))*
((-b-2*c*x+(-4*a*c+b^2)^(1/2))/(-4*a*c+b^2)^(1/2))^(-1-p)/c^2/(1+p)/(3+2*p)/(-4*a*c+b^2)^(1/2)

________________________________________________________________________________________

Rubi [A]
time = 0.06, antiderivative size = 211, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, integrand size = 19, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.105, Rules used = {793, 638} \begin {gather*} \frac {2^p \left (-\frac {-\sqrt {b^2-4 a c}+b+2 c x}{\sqrt {b^2-4 a c}}\right )^{-p-1} \left (a+b x+c x^2\right )^{p+1} \left (2 a B c+A b c (2 p+3)+b^2 (-B) (p+2)\right ) \, _2F_1\left (-p,p+1;p+2;\frac {b+2 c x+\sqrt {b^2-4 a c}}{2 \sqrt {b^2-4 a c}}\right )}{c^2 (p+1) (2 p+3) \sqrt {b^2-4 a c}}-\frac {\left (a+b x+c x^2\right )^{p+1} (-A c (2 p+3)+b B (p+2)-2 B c (p+1) x)}{2 c^2 (p+1) (2 p+3)} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[x*(A + B*x)*(a + b*x + c*x^2)^p,x]

[Out]

-1/2*((b*B*(2 + p) - A*c*(3 + 2*p) - 2*B*c*(1 + p)*x)*(a + b*x + c*x^2)^(1 + p))/(c^2*(1 + p)*(3 + 2*p)) + (2^
p*(2*a*B*c - b^2*B*(2 + p) + A*b*c*(3 + 2*p))*(-((b - Sqrt[b^2 - 4*a*c] + 2*c*x)/Sqrt[b^2 - 4*a*c]))^(-1 - p)*
(a + b*x + c*x^2)^(1 + p)*Hypergeometric2F1[-p, 1 + p, 2 + p, (b + Sqrt[b^2 - 4*a*c] + 2*c*x)/(2*Sqrt[b^2 - 4*
a*c])])/(c^2*Sqrt[b^2 - 4*a*c]*(1 + p)*(3 + 2*p))

Rule 638

Int[((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_), x_Symbol] :> With[{q = Rt[b^2 - 4*a*c, 2]}, Simp[(-(a + b*x + c*
x^2)^(p + 1)/(q*(p + 1)*((q - b - 2*c*x)/(2*q))^(p + 1)))*Hypergeometric2F1[-p, p + 1, p + 2, (b + q + 2*c*x)/
(2*q)], x]] /; FreeQ[{a, b, c, p}, x] && NeQ[b^2 - 4*a*c, 0] &&  !IntegerQ[4*p]

Rule 793

Int[((d_.) + (e_.)*(x_))*((f_.) + (g_.)*(x_))*((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_), x_Symbol] :> Simp[(-(b
*e*g*(p + 2) - c*(e*f + d*g)*(2*p + 3) - 2*c*e*g*(p + 1)*x))*((a + b*x + c*x^2)^(p + 1)/(2*c^2*(p + 1)*(2*p +
3))), x] + Dist[(b^2*e*g*(p + 2) - 2*a*c*e*g + c*(2*c*d*f - b*(e*f + d*g))*(2*p + 3))/(2*c^2*(2*p + 3)), Int[(
a + b*x + c*x^2)^p, x], x] /; FreeQ[{a, b, c, d, e, f, g, p}, x] && NeQ[b^2 - 4*a*c, 0] &&  !LeQ[p, -1]

Rubi steps

\begin {align*} \int x (A+B x) \left (a+b x+c x^2\right )^p \, dx &=-\frac {(b B (2+p)-A c (3+2 p)-2 B c (1+p) x) \left (a+b x+c x^2\right )^{1+p}}{2 c^2 (1+p) (3+2 p)}-\frac {\left (2 a B c-b^2 B (2+p)+A b c (3+2 p)\right ) \int \left (a+b x+c x^2\right )^p \, dx}{2 c^2 (3+2 p)}\\ &=-\frac {(b B (2+p)-A c (3+2 p)-2 B c (1+p) x) \left (a+b x+c x^2\right )^{1+p}}{2 c^2 (1+p) (3+2 p)}+\frac {2^p \left (2 a B c-b^2 B (2+p)+A b c (3+2 p)\right ) \left (-\frac {b-\sqrt {b^2-4 a c}+2 c x}{\sqrt {b^2-4 a c}}\right )^{-1-p} \left (a+b x+c x^2\right )^{1+p} \, _2F_1\left (-p,1+p;2+p;\frac {b+\sqrt {b^2-4 a c}+2 c x}{2 \sqrt {b^2-4 a c}}\right )}{c^2 \sqrt {b^2-4 a c} (1+p) (3+2 p)}\\ \end {align*}

________________________________________________________________________________________

Mathematica [C] Result contains higher order function than in optimal. Order 6 vs. order 5 in optimal.
time = 0.37, size = 210, normalized size = 1.00 \begin {gather*} \frac {1}{6} x^2 \left (\frac {b-\sqrt {b^2-4 a c}+2 c x}{b-\sqrt {b^2-4 a c}}\right )^{-p} \left (\frac {b+\sqrt {b^2-4 a c}+2 c x}{b+\sqrt {b^2-4 a c}}\right )^{-p} (a+x (b+c x))^p \left (3 A F_1\left (2;-p,-p;3;-\frac {2 c x}{b+\sqrt {b^2-4 a c}},\frac {2 c x}{-b+\sqrt {b^2-4 a c}}\right )+2 B x F_1\left (3;-p,-p;4;-\frac {2 c x}{b+\sqrt {b^2-4 a c}},\frac {2 c x}{-b+\sqrt {b^2-4 a c}}\right )\right ) \end {gather*}

Warning: Unable to verify antiderivative.

[In]

Integrate[x*(A + B*x)*(a + b*x + c*x^2)^p,x]

[Out]

(x^2*(a + x*(b + c*x))^p*(3*A*AppellF1[2, -p, -p, 3, (-2*c*x)/(b + Sqrt[b^2 - 4*a*c]), (2*c*x)/(-b + Sqrt[b^2
- 4*a*c])] + 2*B*x*AppellF1[3, -p, -p, 4, (-2*c*x)/(b + Sqrt[b^2 - 4*a*c]), (2*c*x)/(-b + Sqrt[b^2 - 4*a*c])])
)/(6*((b - Sqrt[b^2 - 4*a*c] + 2*c*x)/(b - Sqrt[b^2 - 4*a*c]))^p*((b + Sqrt[b^2 - 4*a*c] + 2*c*x)/(b + Sqrt[b^
2 - 4*a*c]))^p)

________________________________________________________________________________________

Maple [F]
time = 0.35, size = 0, normalized size = 0.00 \[\int x \left (B x +A \right ) \left (c \,x^{2}+b x +a \right )^{p}\, dx\]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(x*(B*x+A)*(c*x^2+b*x+a)^p,x)

[Out]

int(x*(B*x+A)*(c*x^2+b*x+a)^p,x)

________________________________________________________________________________________

Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*(B*x+A)*(c*x^2+b*x+a)^p,x, algorithm="maxima")

[Out]

integrate((B*x + A)*(c*x^2 + b*x + a)^p*x, x)

________________________________________________________________________________________

Fricas [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*(B*x+A)*(c*x^2+b*x+a)^p,x, algorithm="fricas")

[Out]

integral((B*x^2 + A*x)*(c*x^2 + b*x + a)^p, x)

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int x \left (A + B x\right ) \left (a + b x + c x^{2}\right )^{p}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*(B*x+A)*(c*x**2+b*x+a)**p,x)

[Out]

Integral(x*(A + B*x)*(a + b*x + c*x**2)**p, x)

________________________________________________________________________________________

Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*(B*x+A)*(c*x^2+b*x+a)^p,x, algorithm="giac")

[Out]

integrate((B*x + A)*(c*x^2 + b*x + a)^p*x, x)

________________________________________________________________________________________

Mupad [F]
time = 0.00, size = -1, normalized size = -0.00 \begin {gather*} \int x\,\left (A+B\,x\right )\,{\left (c\,x^2+b\,x+a\right )}^p \,d x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(x*(A + B*x)*(a + b*x + c*x^2)^p,x)

[Out]

int(x*(A + B*x)*(a + b*x + c*x^2)^p, x)

________________________________________________________________________________________